Skip to content

Quiet down dev output: demote browser-made request logs, hide Vite internals - #14956

Open
nickpatt wants to merge 2 commits into
cloudflare:mainfrom
nickpatt:local-explorer-hide-internal-noise
Open

Quiet down dev output: demote browser-made request logs, hide Vite internals#14956
nickpatt wants to merge 2 commits into
cloudflare:mainfrom
nickpatt:local-explorer-hide-internal-noise

Conversation

@nickpatt

@nickpatt nickpatt commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Local dev output fills up with things you never asked for. Your browser fetches a favicon on its own. Chrome DevTools probes for a workspace file on every page load. And under the Vite plugin, your Worker runs inside a runner Durable Object behind a couple of wrapper workers, so the traces fill with machinery that doesn't exist in production.

Two separate changes, one commit each.

Browser-made requests are logged at debug, not dropped

/favicon.ico and DevTools' /.well-known/appspecific/com.chrome.devtools.json move from info to debug in the wrangler dev request log. A default session is quiet; --log-level debug still shows every request the Worker served. Nothing is thrown away.

If the Worker returns a 5xx serving one of them it stays at info, so a handler that broke is never quietly demoted.

Vite's internal plumbing is hidden from the Observability views

Vite's own module-init and export-type requests were listed as traces, and its module-runner RPC dispatch as logs. In one real session that was 8 of 11 rows in the Traces list. None of it exists in a deployed Worker, so it's hidden, and the show/hide toggle it used to sit behind is gone.

Span-level hiding inside a trace already existed and was already on by default — what's new is the trace list and the Events view, neither of which filtered Vite at all.

Deliberately not included

Favicon requests still appear in the Observability views. An earlier version of this PR hid them there too, and that was wrong: the Events view is built to mirror the production Logs view, and favicon requests are real requests that do show up in production. Hiding them locally would make the mirror lie. The pre-existing code already drew this line — "Favicon requests are intentionally left in — they're at least driven by real navigation" — and only the DevTools probe, which is pure tooling traffic, stays filtered there.

That's also why the terminal change demotes rather than drops: the complaint was about noise in the terminal, and demoting fixes that without pretending a request didn't happen.

Notes on the Vite filtering

  • Matched by URL path, not wrapper-worker name. Vite routes every request through its router worker, so matching a root span by name would have hidden all your real traffic along with the plumbing.
  • The executeCallback rule only fires inside a trace already known to be Vite. A wrangler dev user can legitimately have their own RPC method with that name, and silently dropping their logs would be the worst outcome here.
  • Failures are never hidden, and error-level logs always show.
  • Filtering happens in SQL rather than on the returned rows, so LIMIT counts only what you'll actually see.

Checked against real capture stores from both a vite dev and a wrangler dev session, including that the Vite rules leave a wrangler dev session completely alone.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: this is a local dev-experience refinement (reducing log/UI noise) with no new public API, binding, or config surface.

@changeset-bot

changeset-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 24c0715

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
miniflare Patch
wrangler Patch
@cloudflare/deploy-helpers Patch
@cloudflare/pages-shared Patch
@cloudflare/remote-bindings Patch
@cloudflare/runtime-types Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Jul 31, 2026
@workers-devprod
workers-devprod requested review from a team and edmundhung and removed request for a team July 31, 2026 19:18
@workers-devprod

workers-devprod commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/demote-browser-request-logs.md: [@cloudflare/wrangler]
  • .changeset/hide-vite-internals.md: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/tests/observability/observability.test.ts: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/utils/observability.ts: [@cloudflare/wrangler]
  • packages/miniflare/src/workers/core/entry.worker.ts: [@cloudflare/wrangler]
  • packages/miniflare/test/index.spec.ts: [@cloudflare/wrangler]

@pkg-pr-new

pkg-pr-new Bot commented Jul 31, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@14956

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@14956

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@14956

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14956

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14956

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14956

miniflare

npm i https://pkg.pr.new/miniflare@14956

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@14956

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14956

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14956

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14956

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14956

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@14956

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14956

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14956

wrangler

npm i https://pkg.pr.new/wrangler@14956

commit: 24c0715

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@nickpatt
nickpatt force-pushed the local-explorer-hide-internal-noise branch from 7147eed to 6c7a7ec Compare August 3, 2026 16:37
@nickpatt nickpatt changed the title [miniflare] Hide favicon and DevTools noise from dev logs and Observability Hide browser and Vite-internal noise from dev logs and Observability Aug 3, 2026
Comment on lines +417 to +419
// Still log these when the Worker actually broke serving them. An unserved
// path answers 404, so only a 5xx counts as a failure worth surfacing.
if (LOG_NOISE_PATHS.has(url.pathname) && res.status < 500) return res;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should drop any logs from the terminal. They are all legit request. If we find them noisy, how about filtering them in the Local Explorer UI? There could be toggles for user to opt-out too if they wanna see everything.

A browser fetches /favicon.ico on its own and Chrome DevTools probes a
.well-known path on every page load. Neither is a request the developer made, and
on a page you reload often they crowd out the app's own traffic.

Demoted to debug rather than dropped, so the default session is quiet but
--log-level debug still shows every request the Worker served. A 5xx stays at
info, so a handler that broke is never quietly demoted.
@nickpatt
nickpatt force-pushed the local-explorer-hide-internal-noise branch from 6c7a7ec to 4a3a426 Compare August 3, 2026 20:35
@nickpatt nickpatt changed the title Hide browser and Vite-internal noise from dev logs and Observability Quiet down dev output: demote browser-made request logs, hide Vite internals Aug 3, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment on lines +720 to +723
// Filter in SQL, not on the returned rows, so LIMIT counts only visible logs.
if (!SHOW_VITE_INTERNALS) {
where.push(`(l.level = 'error' OR NOT ${LOG_IS_VITE_INTERNAL})`);
}

@devin-ai-integration devin-ai-integration Bot Aug 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Start-up messages printed by your own Worker disappear from the local Logs view when using the Vite plugin

Console output produced while your Worker's modules are first loaded is filtered out of the Logs list (LOG_IS_VITE_INTERNAL used at packages/local-explorer-ui/src/utils/observability.ts:722) together with Vite's own plumbing output, so messages you wrote yourself silently never appear.

Impact: Under vite dev, anything logged at module top level (e.g. a start-up banner or a library's init message) is missing from the Local Explorer's Logs view with no indication it was hidden.

How module-evaluation logs end up attributed to the runner-dispatch span

Vite's module runner evaluates the user's modules inside the runner Durable Object via stub.executeCallback(id) (packages/vite-plugin-cloudflare/src/workers/runner-worker/module-runner.ts:51). That RPC produces an invocation whose onset span is named jsrpc with jsrpc.method = executeCallback (packages/miniflare/src/workers/observability/tail-to-store.ts:125-126). Any console.log executed during that invocation is stored with that span's id (tail-to-store.ts:334-349).

runnerDispatchJsrpcSql("sp") matches exactly that span, and in a Vite session the EXISTS wrapper-span check is always satisfied, so (l.level = 'error' OR NOT LOG_IS_VITE_INTERNAL) drops every non-error log emitted during module evaluation — including the user's own top-level logs, not just Vite's. Only error-level logs survive.

The waterfall-side rule (stripDevRunnerSpans) only hides spans, so this log-level consequence is new.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

…ility views

Vite makes its own requests to drive the module runner. Those were listed as
traces alongside the app's own, and their RPC dispatch showed up as logs — 8 of 11
rows in the Traces list for one real session. They aren't requests the developer
made and don't exist in a deployed Worker.

Matched by URL path rather than wrapper-service name, because Vite routes every
request through its router worker — matching a root span by name would have hidden
the user's real traffic too. The executeCallback shape rule only applies inside a
trace already known to be Vite, so a wrangler dev user with an RPC method of that
name keeps their logs. Failures are never hidden.

The existing show/hide toggle for runner spans is untouched.
@nickpatt
nickpatt force-pushed the local-explorer-hide-internal-noise branch from 4a3a426 to 24c0715 Compare August 3, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

3 participants